<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">
<ui:composition template="/WEB-INF/templates/forprimelayout.xhtml">
	<ui:define name="content">
<p:layout fullPage="true">

    <p:layoutUnit position="north" size="100" header="Top" resizable="true" closable="true" collapsible="true">
        <h:outputText value="North unit content." />
    </p:layoutUnit>

    <p:layoutUnit position="south" size="100" header="Bottom" resizable="true" closable="true" collapsible="true">
        <h:outputText value="South unit content." />
    </p:layoutUnit>

    <p:layoutUnit position="west" size="200" header="Left" resizable="true" closable="true" collapsible="true">
	

    <h:form>
			<p:growl id="messages"/>  

	    <p:panelMenu style="width:200px">  
	        <p:submenu label="Ajax Menuitems">  
	            <p:menuitem value="Alunni" actionListener="#{menuBean.alunni()}" update="messages" icon="ui-icon-disk" />  
	            <p:menuitem value="Classi" actionListener="#{menuBean.classi()}" update="messages"  icon="ui-icon-arrowrefresh-1-w" />  
	        </p:submenu>  
	        <p:separator />  
	        <p:submenu label="Links" >  
	            <p:submenu label="Navigazione" icon="ui-icon-extlink">  
	                <p:submenu label="PrimeFaces" icon="ui-icon-heart">  
	                    <p:menuitem value="Home" url="http://www.primefaces.org" icon="ui-icon-home" />  
	                    <p:menuitem value="Docs" url="http://www.primefaces.org/documentation.html" icon="ui-icon-document" />  
	                    <p:menuitem value="Download" url="http://www.primefaces.org/downloads.html" icon="ui-icon-arrowthick-1-s" />  
	                    <p:menuitem value="Support" url="http://www.primefaces.org/support.html" icon="ui-icon-wrench" />  
	                </p:submenu>  
	            </p:submenu>  
	            <p:menuitem value="logout" outcome="/login" icon="ui-icon-signal"/>  
	        </p:submenu>  
	    </p:panelMenu>  


    </h:form>

    </p:layoutUnit>

    <p:layoutUnit position="east" size="200" header="Right" resizable="true" closable="true" collapsible="true" effect="drop">
        <h:outputText value="Right unit content." />
    </p:layoutUnit>

    <p:layoutUnit position="center">
<h:form id="form">

    <p:growl id="messages" showDetail="true"/>

    <p:contextMenu for="giudizi" widgetVar="cMenu">   
        <p:menuitem value="Edit Cell" icon="ui-icon-search" onclick="PF('giudiziTable').showCellEditor();return false;"/>  
        <p:menuitem value="Hide Menu" icon="ui-icon-close" onclick="PF('cMenu').hide()"/>  
    </p:contextMenu> 


    <p:dataTable id="giudizi" var="giudizio" value="#{tableBean.giudizioList}" editable="true" editMode="cell" widgetVar="giudiziTable" cellSeparator=" \/ ">

        <f:facet name="header">
        	Inserimento Giudizi 
        </f:facet>

        <p:column headerText="Studente" style="width:50%">
            <p:cellEditor>
                <f:facet name="output"><h:outputText value="#{giudizio.alunno.nome}" /> </f:facet>
                <f:facet name="input">
                    <p:inputText  disabled="y"  id="nomeStudenteInput" value="#{giudizio.alunno.nome}" style="width:46%" title="Studente"/>
                </f:facet>
            </p:cellEditor>
        </p:column>

        <p:column headerText="Giudizio" style="width:25%">
            <p:cellEditor>
                <f:facet name="output"><h:outputText value="#{giudizio.valore}" /></f:facet>
                <f:facet name="input">
				    <h:panelGrid columns="1" style="margin-bottom:10px">  
				        <h:outputText id="output" value="Imposta Voto =  #{giudizio.progressivo}"/>  
				        <h:inputHidden id="txt2" value="#{giudizio.progressivo}">  
				        </h:inputHidden>
				        <p:slider id="slider1" maxValue="12" minValue="0" step="1"  for="txt2" display="output" style="width:200px"  >
				        </p:slider>  
				    </h:panelGrid> 

                </f:facet>
            </p:cellEditor>
        </p:column>


    </p:dataTable>


</h:form>
                    
    </p:layoutUnit>

</p:layout>
                        

	</ui:define>
</ui:composition>
</html>